<?php

// $Id: vpage_sitemap_form.class.php 1570 2009-01-13 12:44:02Z ogrebg $

require_once(TANGRA_MAIN_DIR.'form/guardable_form.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/select/form_field_select.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/checkbox/form_field_checkbox.class.php');
require_once(TANGRA_MAIN_DIR.'/form/static_html_form_generator.class.php');



class VPage_Sitemap_Form extends Guardable_Form {
	function __construct() {
		parent::__construct('vpage_sitemap', 'admin/modules/tangra_cms/vpage_sitemap/vpage_sitemap_edit.php');

		$f_in_sitemap = new Form_Field_Checkbox('in_sitemap', false);
		$this->add_field($f_in_sitemap);

		$f_sitemap_weight = new Form_Field_Select('sitemap_weight', '0.5', true);
		$f_sitemap_weight->add_option('0.0');
		$f_sitemap_weight->add_option('0.1');
		$f_sitemap_weight->add_option('0.2');
		$f_sitemap_weight->add_option('0.3');
		$f_sitemap_weight->add_option('0.4');
		$f_sitemap_weight->add_option('0.5');
		$f_sitemap_weight->add_option('0.6');
		$f_sitemap_weight->add_option('0.7');
		$f_sitemap_weight->add_option('0.8');
		$f_sitemap_weight->add_option('0.9');
		$f_sitemap_weight->add_option('1.0');
		$this->add_field($f_sitemap_weight);

		$f_sitemap_change_freq = new Form_Field_Select('sitemap_change_freq', '4', true);
		$f_sitemap_change_freq->add_option('0');
		$f_sitemap_change_freq->add_option('1');
		$f_sitemap_change_freq->add_option('2');
		$f_sitemap_change_freq->add_option('3');
		$f_sitemap_change_freq->add_option('4');
		$f_sitemap_change_freq->add_option('5');
		$f_sitemap_change_freq->add_option('6');
		$this->add_field($f_sitemap_change_freq);
	}


	public function generate_html() {
		$html_gen = new Static_HTML_Form_Generator($this, 'modules/form_html_tpl_static_ajax_metallic_en', 'en');
		$html_gen->create_default_tpl_maps();

		printbr('<pre>');
		printbr(htmlentities($html_gen->get_static_html()));
		printbr('</pre>');
	}
}
